package com.baor.dao;

import com.baor.domain.UserVo;
import com.github.yulichang.base.mapper.MPJJoinMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public interface UserDao extends MPJJoinMapper<UserVo> {

    @Select("select * from t_user where user_account = #{username}")
    UserVo selectUserByUserName(String username);

    @Update("update t_user set user_role = #{roleId2} where user_id in  (select * from (select user_id from t_user where user_role = #{roleId}) as a)")
    Integer updateRole(Map<String,Object> map);

}
